<?php
class ControllerCommonAdmincp extends AdminController {
	public function index() {
		
		$this->data['title'] = C('config_name');
		
		if (isset($this->request->server['HTTPS'])
				&& (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
			$this->data['base'] = HTTPS_SERVER;
		} else {
			$this->data['base'] = HTTP_SERVER;
		}
		
		$this->data['stores'] = array();
		
		if (!$this->user->isLogged() || !isset($this->request->get['token']) || !isset($this->session->data['token'])
				|| ($this->request->get['token'] != $this->session->data['token'])) {
			$this->data['logged'] = '';
			$this->data['home'] = $this->url->link('common/login', '', 'SSL');
		} else {
			$this->data['logged'] = sprintf($this->_['text_logged'], $this->user->getUserName());
			$this->data['home'] = UA('common/home');
		}
		$this->data['service_time'] = date('Y/m/d H:i', $GLOBALS['V5_TIME']);
		$this->display('common/admincp.tpl', false);
	}
}